file object

This method will close any file associated with the object.

bool close()

Parameters:
None.

Return value:
true on success, false on failure.

Remarks:
Closing a file is useful when you want to release the current file that is associated with the object in order to save resources, while still keeping the object alive for future use. This method is executed automatically when a file object is destroyed, so you need not worry about calling it to clean up after yourself at the end of your script for example if you do not wish to. This method is also executed if you call the open method on a file object that already has a file associated with it.

Example:
// Open a file, write some text and close it.

void main()
{
file test;
test.open("c:\\test.txt", "w");
test.write("I am a text file!");
test.close();
}